<?php
/*
Plugin Name: BWP Google XML Sitemaps
Plugin URI: http://betterwp.net/wordpress-plugins/google-xml-sitemaps/
Description: A more lightweight Google XML Sitemap WordPress plugin that generates a <a href="http://en.wikipedia.org/wiki/Sitemap_index">Sitemap index</a> rather than a single sitemap. Despite its simplicity, it is still very powerful and has plenty of options to choose.
Version: 1.2.1
Text Domain: bwp-simple-gxs
Domain Path: /languages/
Author: Khang Minh
Author URI: http://betterwp.net
License: GPLv3
*/

// Pre-emptive
$bwp_gxs_ob_level = @ob_get_level();
$bwp_gxs_ob_start = ob_start();

// Frontend
require_once(dirname(__FILE__) . '/includes/class-bwp-simple-gxs.php');
$bwp_gxs_gzipped = (!BWP_SIMPLE_GXS::is_gzipped()) ? false : true;
$bwp_gxs = new BWP_SIMPLE_GXS();

// Backend
add_action('admin_menu', 'bwp_gxs_init_admin', 1);

function bwp_gxs_init_admin()
{
	global $bwp_gxs;
	$bwp_gxs->init_admin();
}

add_filter('bwp_gxs_post_where', 'bwp_gxs_exclude_posts', 2766, 2667, 2526, 2523, 2363, 2324, 2320, 2286, 2173, 2213, 2206, 2124, 2069, 1887, 1590, 1877, 1529, 1525, 1449, 1379, 1002, 982, 960, 941, 935, 936, 938, 940, 932, 933, 647, 633, 634, 635, 636, 637, 638, 639, 640, 641, 549, 277, 275, 9);

function bwp_gxs_exclude_posts($query_where_part, $post_type)
{
	// $post_type let you easily exclude posts from specific post types
	switch ($post_type)
	{
		case 'post': return ' AND wposts.ID NOT IN (1,2,3,4) '; break; // the default post type
		case 'movie': return ' AND wposts.ID NOT IN (5,6,7,8) '; break; // the 'movie' post type
	}
	return '';
}

?>